<template>
	<view>
		<u-tabs :list="list" 
			:is-scroll="false" 
			:current="current" 
			@change="change"
			:active-color="appTheme.checkColor"
			/>
		<clientele-list ref="clientele0" v-show="current === 0" :type="0"></clientele-list>
		<clientele-list ref="clientele1" v-show="current === 1" :type="1"></clientele-list>
		<clientele-list ref="clientele2" v-show="current === 2" :type="2"></clientele-list>
		<clientele-list ref="clientele3" v-show="current === 3" :type="3"></clientele-list>
	</view>
</template>

<script>
	import ClienteleList from '@/pages_operate/clientele/clientele-list.vue'
	import appMixin from '@/mixins/app.js'
	export default {
		mixins: [appMixin],
		components: {
			ClienteleList
		},
		data() {
			return {
				list: [{
					name: 'A类'
				}, {
					name: '待续约'
				}, {
					name: '待补款',
				}, {
					name: '全部',
				}],
				current: 0
			}
		},
		methods: {
			change(index) {
				this.current = index;
			},
			
			onReachBottom() {
				console.log('onReachBottom');
				if (this.current === 0){
					this.$refs.clientele0.loadMore();
				} else if (this.current === 1) {
					this.$refs.clientele1.loadMore();
				} else if (this.current === 2) {
					this.$refs.clientele2.loadMore();
				} else if (this.current === 3) {
					this.$refs.clientele3.loadMore();
				}
			},
		}
	}
</script>

<style>

</style>
